﻿@{
    ViewBag.Title = "奖品管理";
}
@using PagedList
@using PagedList.Mvc
@model PagedList.IPagedList<zqdn.Web.ViewModels.GoodsViewModel>

<div class="pageheader">
    <h2><i class="fa fa-user"></i> 奖品列表 </h2>
</div>

<div class="contentpanel">
    <div class="row">
        <a href="/admin/Goods/Create" class="btn btn-primary">添加奖品</a>
    </div>
    <div class="row">
        <div class="table-responsive">
            <table class="table table-hidaction table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>奖品名</th>
                        <th>图片</th>
                        <th width="6%">操作</th>
                    </tr>
                </thead>
                <tbody>
                  @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.ID</td> 
                            <td>@item.Name</td>
                            <td>
                                @if (!string.IsNullOrEmpty(item.GoodImg))
                                {
                                    <img src="@item.GoodImg" style="max-width:300px;"/>
                                }
                            </td>
                            <td>
                                <a href="/admin/Goods/edit?id=@item.ID">编辑</a>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div><!-- table-responsive -->
        @Html.PagedListPager((PagedList.IPagedList)Model, page => Url.Action("Index", new
                           {
                               page,
                               adName = ViewBag.AdName
                           })
                            , PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(
                            new PagedListRenderOptions()
                            {
                                LinkToPreviousPageFormat = "上一页",
                                LinkToNextPageFormat = "下一页",
                                MaximumPageNumbersToDisplay = 5
                            }, new AjaxOptions()
                            {
                                HttpMethod = "GET"
                            }))
    </div><!-- row -->
</div>
 
 